<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_address', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->default(0)->comment("用户ID");
            $table->string("consignee",50)->default('')->comment("收货人");
            $table->string("mobile",20)->default('')->comment("联系电话");
            $table->integer("province_code")->default(0)->comment("省代码");
            $table->integer("city_code")->default(0)->comment("市代码");
            $table->integer("district_code")->default(0)->comment("区代码");
            $table->string("address",100)->default('')->comment("详细地址");
            $table->char("postal_code",6)->default('')->comment("邮政编码");
            $table->tinyInteger("selected")->default(0)->comment("是否选中");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_address');
    }
}
